<?php
namespace My\Controller;
use Utuo\BackgroundController;
class MicroSeckillController extends BackgroundController
{ 
	
	public function _initialize() {
		$this->setControllerTitle('微秒杀管理');
			$this->setActionTitle(array(
				'index' => '微秒杀列表',
				'add' =>'添加微秒杀',
				'recycle' => '回收站',
				'modify' => '修改微秒杀'
		));
		$this->setActionNav(array(
				'index',
				'add',
				'recycle'
		));
	}
	public function getLists($is_deleted){
		$condation=array(
			'is_deleted'=>$is_deleted,
			'cid'=>$this->aid	
		);
		$microSeckill=D("MicroSeckill")->where($condation)->page($this->getPage(),$this->getPageSize())->select();
		foreach ($microSeckill as &$v)
		{
			$v['url']=$_SERVER['HTTP_HOST']."/index.php/Home/MicroSeckill/index/sid/{$this->aid}";
		}
		$total=D("MicroSeckill")->where($condation)->count();
		$this->showPage($total, $this->getPageSize());
		$this->microSeckill=$microSeckill;
		$this->display();
	}
	
	
}